package com.eastfair.venuebooking.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 客户表
 * </p>
 *
 * @author dqq
 * @since 2023-01-05
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("vb_customer_main")
@ApiModel(value = "CustomerMain", description = "客户表")
@AllArgsConstructor
public class CustomerMain extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 归属人员
     */
    @ApiModelProperty(value = "归属人员")
    @TableField(value = "belong_to")
    @Excel(name = "归属人员")
    private Long belongTo;

    /**
     * 归属人员姓名
     */
    @ApiModelProperty(value = "归属人员姓名")
    @Size(max = 255, message = "归属人员姓名长度不能超过255")
    @TableField(value = "belong_to_name", condition = LIKE)
    @Excel(name = "归属人员姓名")
    private String belongToName;

    /**
     * 归属人员部门id
     */
    @ApiModelProperty(value = "归属人员部门id")
    @TableField(value = "org_code")
    @Excel(name = "归属人员部门id")
    private Long orgCode;

    /**
     * 归属部门名称
     */
    @ApiModelProperty(value = "归属部门名称")
    @Size(max = 64, message = "归属部门名称长度不能超过64")
    @TableField(value = "org_name", condition = LIKE)
    @Excel(name = "归属部门名称")
    private String orgName;

    /**
     * 前归属部门ID
     */
    @ApiModelProperty(value = "前归属部门ID")
    @TableField(value = "last_org_code")
    @Excel(name = "前归属部门ID")
    private Long lastOrgCode;

    /**
     * 前归属部门名称
     */
    @ApiModelProperty(value = "前归属部门名称")
    @Size(max = 64, message = "前归属部门名称长度不能超过64")
    @TableField(value = "last_org_name", condition = LIKE)
    @Excel(name = "前归属部门名称")
    private String lastOrgName;

    /**
     * 客户中文名称
     */
    @ApiModelProperty(value = "客户中文名称")
    @Size(max = 75, message = "客户中文名称长度不能超过75")
    @TableField(value = "customer_cn_name", condition = LIKE)
    @Excel(name = "客户中文名称")
    private String customerCnName;

    /**
     * 客户中文名称拼音
     */
    @ApiModelProperty(value = "客户中文名称拼音")
    @Size(max = 255, message = "客户中文名称拼音长度不能超过255")
    @TableField(value = "customer_name_pinyin", condition = LIKE)
    @Excel(name = "客户中文名称拼音")
    private String customerNamePinyin;

    /**
     * 客户英文名称
     */
    @ApiModelProperty(value = "客户英文名称")
    @Size(max = 255, message = "客户英文名称长度不能超过255")
    @TableField(value = "customer_en_name", condition = LIKE)
    @Excel(name = "客户英文名称")
    private String customerEnName;

    /**
     * 客户简称
     */
    @ApiModelProperty(value = "客户简称")
    @Size(max = 75, message = "客户简称长度不能超过75")
    @TableField(value = "customer_short_name", condition = LIKE)
    @Excel(name = "客户简称")
    private String customerShortName;

    /**
     * 客户性质，同名数据字典
     */
    @ApiModelProperty(value = "客户性质，同名数据字典")
    @Size(max = 64, message = "客户性质，同名数据字典长度不能超过64")
    @TableField(value = "customer_property", condition = LIKE)
    @Excel(name = "客户性质，同名数据字典")
    private String customerProperty;

    /**
     * 所属行业(同名数据字典)
     */
    @ApiModelProperty(value = "所属行业(同名数据字典)")
    @Size(max = 64, message = "所属行业(同名数据字典)长度不能超过64")
    @TableField(value = "customer_industry", condition = LIKE)
    @Excel(name = "所属行业(同名数据字典)")
    private String customerIndustry;

    /**
     * 客户状态(同名数据字典)
     */
    @ApiModelProperty(value = "客户状态(同名数据字典)")
    @Size(max = 64, message = "客户状态(同名数据字典)长度不能超过64")
    @TableField(value = "customer_status", condition = LIKE)
    @Excel(name = "客户状态(同名数据字典)")
    private String customerStatus;

    /**
     * 统一社会信用代码
     */
    @ApiModelProperty(value = "统一社会信用代码")
    @Size(max = 255, message = "统一社会信用代码长度不能超过255")
    @TableField(value = "uscc", condition = LIKE)
    @Excel(name = "统一社会信用代码")
    private String uscc;

    /**
     * 客户星级，同名字典
     */
    @ApiModelProperty(value = "客户星级，同名字典")
    @Size(max = 64, message = "客户星级，同名字典长度不能超过64")
    @TableField(value = "customer_level", condition = LIKE)
    @Excel(name = "客户星级，同名字典")
    private String customerLevel;

    /**
     * 客户类型，同名数据字典
     */
    @ApiModelProperty(value = "客户类型，同名数据字典")
    @Size(max = 64, message = "客户类型，同名数据字典长度不能超过64")
    @TableField(value = "customer_type", condition = LIKE)
    @Excel(name = "客户类型，同名数据字典")
    private String customerType;

    /**
     * 客户来源，同名数据字典
     */
    @ApiModelProperty(value = "客户来源，同名数据字典")
    @Size(max = 64, message = "客户来源，同名数据字典长度不能超过64")
    @TableField(value = "customer_source", condition = LIKE)
    @Excel(name = "客户来源，同名数据字典")
    private String customerSource;

    /**
     * 地区
     */
    @ApiModelProperty(value = "地区")
    @Size(max = 255, message = "地区长度不能超过255")
    @TableField(value = "region", condition = LIKE)
    @Excel(name = "地区")
    private String region;

    /**
     * 详细地址
     */
    @ApiModelProperty(value = "详细地址")
    @Size(max = 255, message = "详细地址长度不能超过255")
    @TableField(value = "address", condition = LIKE)
    @Excel(name = "详细地址")
    private String address;

    /**
     * 固定电话
     */
    @ApiModelProperty(value = "固定电话")
    @Size(max = 64, message = "固定电话长度不能超过64")
    @TableField(value = "phone", condition = LIKE)
    @Excel(name = "固定电话")
    private String phone;

    /**
     * 传真号码
     */
    @ApiModelProperty(value = "传真号码")
    @Size(max = 64, message = "传真号码长度不能超过64")
    @TableField(value = "fax_no", condition = LIKE)
    @Excel(name = "传真号码")
    private String faxNo;

    /**
     * 电子邮箱
     */
    @ApiModelProperty(value = "电子邮箱")
    @Size(max = 64, message = "电子邮箱长度不能超过64")
    @TableField(value = "email", condition = LIKE)
    @Excel(name = "电子邮箱")
    private String email;

    /**
     * QQ号码
     */
    @ApiModelProperty(value = "QQ号码")
    @Size(max = 20, message = "QQ号码长度不能超过20")
    @TableField(value = "qq", condition = LIKE)
    @Excel(name = "QQ号码")
    private String qq;

    /**
     * 企业网址
     */
    @ApiModelProperty(value = "企业网址")
    @Size(max = 64, message = "企业网址长度不能超过64")
    @TableField(value = "website", condition = LIKE)
    @Excel(name = "企业网址")
    private String website;

    /**
     * 企业规模，同名数据字典
     */
    @ApiModelProperty(value = "企业规模，同名数据字典")
    @Size(max = 64, message = "企业规模，同名数据字典长度不能超过64")
    @TableField(value = "company_scale", condition = LIKE)
    @Excel(name = "企业规模，同名数据字典")
    private String companyScale;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Size(max = 1000, message = "备注长度不能超过1000")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "备注")
    private String remark;

    /**
     * 公众号，图片地址
     */
    @ApiModelProperty(value = "公众号，图片地址")
    @Size(max = 255, message = "公众号，图片地址长度不能超过255")
    @TableField(value = "wechat_qrcode_url", condition = LIKE)
    @Excel(name = "公众号，图片地址")
    private String wechatQrcodeUrl;

    /**
     * 最后跟进时间
     */
    @ApiModelProperty(value = "最后跟进时间")
    @TableField(value = "last_follow_date")
    @Excel(name = "最后跟进时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime lastFollowDate;

    /**
     * 前归属人
     */
    @ApiModelProperty(value = "前归属人")
    @TableField(value = "last_belong_to")
    @Excel(name = "前归属人")
    private Long lastBelongTo;

    /**
     * 前归属人姓名
     */
    @ApiModelProperty(value = "前归属人姓名")
    @Size(max = 255, message = "前归属人姓名长度不能超过255")
    @TableField(value = "last_belong_to_name", condition = LIKE)
    @Excel(name = "前归属人姓名")
    private String lastBelongToName;

    /**
     * 下次跟进时间
     */
    @ApiModelProperty(value = "下次跟进时间")
    @TableField(value = "next_follow_date")
    @Excel(name = "下次跟进时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime nextFollowDate;

    /**
     * 客户状态(0正常 1公海 2垃圾 3静默客户)
     */
    @ApiModelProperty(value = "客户状态(0正常 1公海 2垃圾 3静默客户)")
    @TableField(value = "state")
    @Excel(name = "客户状态(0正常 1公海 2垃圾 3静默客户)")
    private Integer state;

    /**
     * cms系统同步状态 0:待同步;1:已同步
     */
    @ApiModelProperty(value = "cms系统同步状态 0:待同步;1:已同步")
    @NotNull(message = "请填写cms系统同步状态 0:待同步;1:已同步")
    @TableField(value = "cms_sync")
    @Excel(name = "cms系统同步状态 0:待同步;1:已同步")
    private Integer cmsSync;


    @Builder
    public CustomerMain(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    Long belongTo, String belongToName, Long orgCode, String orgName, Long lastOrgCode, String lastOrgName, 
                    String customerCnName, String customerNamePinyin, String customerEnName, String customerShortName, String customerProperty, String customerIndustry, 
                    String customerStatus, String uscc, String customerLevel, String customerType, String customerSource, String region, 
                    String address, String phone, String faxNo, String email, String qq, String website, 
                    String companyScale, String remark, String wechatQrcodeUrl, LocalDateTime lastFollowDate, Long lastBelongTo, String lastBelongToName, 
                    LocalDateTime nextFollowDate, Integer state, Integer cmsSync) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.belongTo = belongTo;
        this.belongToName = belongToName;
        this.orgCode = orgCode;
        this.orgName = orgName;
        this.lastOrgCode = lastOrgCode;
        this.lastOrgName = lastOrgName;
        this.customerCnName = customerCnName;
        this.customerNamePinyin = customerNamePinyin;
        this.customerEnName = customerEnName;
        this.customerShortName = customerShortName;
        this.customerProperty = customerProperty;
        this.customerIndustry = customerIndustry;
        this.customerStatus = customerStatus;
        this.uscc = uscc;
        this.customerLevel = customerLevel;
        this.customerType = customerType;
        this.customerSource = customerSource;
        this.region = region;
        this.address = address;
        this.phone = phone;
        this.faxNo = faxNo;
        this.email = email;
        this.qq = qq;
        this.website = website;
        this.companyScale = companyScale;
        this.remark = remark;
        this.wechatQrcodeUrl = wechatQrcodeUrl;
        this.lastFollowDate = lastFollowDate;
        this.lastBelongTo = lastBelongTo;
        this.lastBelongToName = lastBelongToName;
        this.nextFollowDate = nextFollowDate;
        this.state = state;
        this.cmsSync = cmsSync;
    }

}
